{% extends 'resume_manage/base_information.html' %}

{% load static %}

{% block content %}
    <div class="container">
        <h2>求职意向</h2>
        <form id="job-intentions-form" method="post">
            {% csrf_token %}
            <div class="intention-item">
                <div class="form-group">
                    <label for="expected_position">期望职位</label>
                    <input type="text" class="form-control" id="expected_position" name="expected_position"
                           value="{{ form.expected_position }}" required>
                </div>

                <div class="form-group">
                    <label for="job_nature">工作性质</label>
                    <select class="form-control" id="job_nature" name="job_nature" required>
                        <option value="">请选择</option>
                        <option value="全职" {% if form.job_nature == '全职' %}selected{% endif %}>全职</option>
                        <option value="兼职" {% if form.job_nature == '兼职' %}selected{% endif %}>兼职</option>
                        <option value="实习" {% if form.job_nature == '实习' %}selected{% endif %}>实习</option>
                    </select>
                </div>

                <div class="form-group">
                    <label for="expected_location">期望城市</label>
                    <input type="text" class="form-control" id="expected_location" name="expected_location"
                           value="{{ form.expected_location }}" required>
                    <small class="form-text text-muted">可填写多个意向城市，用逗号分隔</small>
                </div>

                <div class="form-group">
                    <label for="expected_salary">期望薪资</label>
                    <select class="form-control" id="expected_salary" name="expected_salary" required>
                        <option value="">请选择</option>
                        <option value="面议" {% if form.expected_salary == '面议' %}selected{% endif %}>面议</option>
                        <option value="2k-5k" {% if form.expected_salary == '2k-5k' %}selected{% endif %}>2k-5k</option>
                        <option value="5k-8k" {% if form.expected_salary == '5k-8k' %}selected{% endif %}>5k-8k</option>
                        <option value="8k-12k" {% if form.expected_salary == '8k-12k' %}selected{% endif %}>8k-12k
                        </option>
                        <option value="12k-15k" {% if form.expected_salary == '12k-15k' %}selected{% endif %}>12k-15k
                        </option>
                        <option value="15k-20k" {% if form.expected_salary == '15k-20k' %}selected{% endif %}>15k-20k
                        </option>
                        <option value="20k-30k" {% if form.expected_salary == '20k-30k' %}selected{% endif %}>20k-30k
                        </option>
                        <option value="30k以上" {% if form.expected_salary == '30k以上' %}selected{% endif %}>30k以上
                        </option>
                    </select>
                </div>

                <div class="form-group">
                    <label for="industry">期望行业</label>
                    <input type="text" class="form-control" id="industry" name="industry"
                           value="{{ form.industry }}">
                </div>

                <div class="form-group">
                    <label for="join_time">可入职时间</label>
                    <select class="form-control" id="join_time" name="join_time" required>
                        <option value="">请选择</option>
                        <option value="随时" {% if form.join_time == '随时' %}selected{% endif %}>随时</option>
                        <option value="一周内" {% if form.join_time == '一周内' %}selected{% endif %}>一周内</option>
                        <option value="一个月内" {% if form.join_time == '一个月内' %}selected{% endif %}>一个月内
                        </option>
                        <option value="三个月内" {% if form.join_time == '三个月内' %}selected{% endif %}>三个月内
                        </option>
                        <option value="待定" {% if form.join_time == '待定' %}selected{% endif %}>待定</option>
                    </select>
                </div>

                <div class="form-group">
                    <label for="job_description">补充说明</label>
                    <textarea class="form-control" id="job_description" name="job_description" rows="3">
                {{ form.job_description }}
            </textarea>
                </div>
            </div>

            <div class="action-buttons">
                <button type="submit" class="btn btn-primary" id="save-intentions">保存</button>
            </div>
        </form>
    </div>

    <script src="https://cdn.jsdelivr.net/npm/sweetalert2@11"></script>
    <script src="{% static 'js/job_intentions.js' %}"></script>
{% endblock %}